Skip to main content
PUT
/
campaigns
/
{id}
cURL
curl --request PUT \
  --url https://app.masivo.ai/api/storefront/v1/campaigns/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "brand_id": "<string>",
  "platforms": [
    {
      "label": "<string>",
      "value": "<string>"
    }
  ],
  "name": "<string>",
  "description": "<string>",
  "rules": "<string>",
  "attributes": {
    "trigger": "PURCHASE",
    "privacy": "PRIVATE"
  },
  "status": "ACTIVE",
  "start_date": "2023-11-07T05:31:56Z",
  "withoutEndDate": true,
  "end_date": "2023-11-07T05:31:56Z",
  "funded_by": "<string>",
  "budget": 1000,
  "divide_budget_in": "daily",
  "labels": [
    {
      "label": "<string>",
      "value": "<string>"
    }
  ],
  "metadata": "<string>",
  "quantity": 123,
  "useCustomCodes": true,
  "customCodes": "<string>",
  "confirm_changes": true,
  "referee_rules_json": "<string>"
}
'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "status": "RUNNING",
    "attributes": {}
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.masivo.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string<uuid>
required

The campaign unique identifier

Query Parameters

type
enum<string>
required

The campaign type

Available options:
BEHAVIOR,
COUPONS,
PUNCH_CARDS,
REFERRALS

Body

application/json

Storefront campaign write payload. Send the campaign type as the required type query parameter, not in the body. The body mirrors the dashboard campaign form for that type. account_id is derived from the SERVER token. Common validation: rules must contain at least one main/referrer rule, metadata must be a JSON object encoded as a string, budget must be at least 1, labels and platforms use dashboard select values, and dates must follow the campaign date restrictions.

brand_id
string | null

The brand id of the campaign, null if is a global campaign

platforms
object[] | null

Platform select values where this campaign applies

name
string

The name of the campaign

description
string

The description of the campaign

rules
string

JSON string with the main/referrer campaign rules. Must contain at least one rule for every campaign type, including REFERRALS. referee_rules_json does not replace this field.

attributes
object

The attributes of the campaign

status
enum<string>

The persisted campaign status for create/update requests

Available options:
ACTIVE,
INACTIVE
start_date
string<date-time>

The start date of the campaign. On create, and on updates for scheduled campaigns, it must be today or later and less than one year from now.

withoutEndDate
boolean

When true, end_date must be omitted and the campaign is stored without an end date.

end_date
string<date-time> | null

The end date of the campaign. Omit it when withoutEndDate is true. When provided, it must be after start_date and less than one year from start_date.

funded_by
string | null

Who is funding these campaign

budget
number

The budget of the campaign

Example:

1000

divide_budget_in
enum<string>
Available options:
daily,
weekly,
monthly,
total
labels
object[]

Label select values

metadata
string

JSON object encoded as a string

quantity
number

COUPONS only. Number of coupon codes to generate or keep. Must be positive and within the safe limit for generated codes.

useCustomCodes
boolean

COUPONS only. When true, customCodes is used instead of generated codes

customCodes
string

COUPONS only. Comma-separated custom coupon codes. Required to contain at least one non-empty code when useCustomCodes is true.

confirm_changes
boolean

COUPONS update only. Required as true when changing code format or quantity

referee_rules_json
string

REFERRALS only. JSON string with referee campaign rules. This is optional and does not replace the required main/referrer rules field.

Response

Campaign updated

data
object

Campaign response. account_id, order, and created_at are not returned.